import csv
class ReadCsv():
    def __init__(self,file_path=r"D:\testLi\PythonWork\xinan_ui\config\北交所买卖代码.csv"):
        self.file_path=file_path
    def read_csv(self):
        with open(self.file_path,'r',encoding='utf-8') as f:
            data=csv.reader(f)
            list_data=[]
            for i in data:
                if len(i)==5:
                    a=int(i[2])
                    b=int(i[3])
                    i.pop()
                    i.pop()
                    i.append(a)
                    i.append(b)
                    list_data.append(i)
                elif len(i)==4:
                    a = int(i[2])
                    i.remove(i[2])
                    i.append(a)
                    list_data.append(i)
                    print(i)
                elif len(i)==3:
                    list_data.append(i)
            return list_data

if __name__ == '__main__':
    #r"D:\testLi\PythonWork\xinan\handle\rong.csv"
    jdz_buydata=ReadCsv(file_path=r"D:\testLi\PythonWork\xinan_ui\config\tjd下单daim.csv").read_csv()
    print(jdz_buydata)